﻿using Microsoft.AspNetCore.Http;

namespace PersonalWebsite.Core.Helpers;

public class FileHelper
{
    private static string GetInternetFileUrl(IHttpContextAccessor httpContextAccessor,string path)
    {
        return $"{httpContextAccessor.HttpContext.Request.Host}/{path}";
    }

    public static string GetProExperienceFile(IHttpContextAccessor httpContextAccessor,string fileName)
    {
        string path = $"imgs/profile/proExperience/{fileName}";

        return $"http://{GetInternetFileUrl(httpContextAccessor, path)}";
    }

    public static string GetTgaGameFile(IHttpContextAccessor httpContextAccessor, string fileName)
    {
        string path = $"imgs/artninth/tga/{fileName}";

        return $"http://{GetInternetFileUrl(httpContextAccessor, path)}";
    }

    public static string GetGameCGFile(IHttpContextAccessor httpContextAccessor, string fileName)
    {
        string path = $"imgs/artninth/cg/{fileName}";

        return $"http://{GetInternetFileUrl(httpContextAccessor, path)}";
    }

    public static string GetShowFile(IHttpContextAccessor httpContextAccessor, string fileName)
    {
        string path = $"imgs/electricsoup/show/{fileName}";

        return $"http://{GetInternetFileUrl(httpContextAccessor, path)}";
    }

    public static string GetBookFile(IHttpContextAccessor httpContextAccessor, string fileName)
    {
        string path = $"imgs/electricsoup/book/{fileName}";

        return $"http://{GetInternetFileUrl(httpContextAccessor, path)}";
    }

    public static string GetHotmovieFile(IHttpContextAccessor httpContextAccessor, string fileName)
    {
        string path = $"imgs/electricsoup/hotmovie/{fileName}";

        return $"http://{GetInternetFileUrl(httpContextAccessor, path)}";
    }
}
